<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>payment-success</title>
</head>
<body>
  <div>
    <h2>恭喜您，支付成功</h2>
    <span id="jumpTo">10</span>秒后返回菜鸟教程location对象页面
    <p><button>返回首页</button></p>
  </div>
  <script>
    // 逻辑：加载页面时，应该触发定时器，10s
    window.onload=function(){
      let timer= 10;
      setInterval(() => {
        timer--;
        document.getElementById('jumpTo').innerText = timer;
        if (timer==0){
          location.href="https://www.runoob.com/jsref/obj-location.html"
        }
      }, 1000);
    }
    document.getElementsByTagName('button')[0].onclick=function(){
      location.href="./payment.html"
    }
  </script>
</body>
</html>